<?php

/**
 * Description of Factory
 *
 * @author a.novikov
 */
class Factory {

	public static function fromUnderscore($underscoreName) {
		return self::getObject( StringFunctions::underscoreToCamelCase($underscoreName) );
	}

	public static function fromUnderscoreComposite($underscoreName, $classNameSuffix = '', $classNamePrefix = '') {
		return self::getObject( StringFunctions::underscoreToCamelCaseComposite($underscoreName, $classNamePrefix, $classNameSuffix) );
	}

	public static function fromComposite($className, $classNameSuffix = '', $classNamePrefix = '') {
		return self::getObject( StringFunctions::composite($className, $classNamePrefix, $classNameSuffix) );
	}

	public static function getObject($class, $methodName = 'getInstance', $arguments = array()) {
		return MethodFunctions::call($class, $methodName, $arguments);
	}
}